package axdoc.rule.def.impl.activity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;

import axdoc.model.SelectValue;
import axdoc.rule.def.SignleRule;

public class BlackRule extends SignleRule {

	private static Logger logger = LoggerFactory.getLogger(BlackRule.class);

	@Override
	public String getName() {
		return "排除黑名单医生";
	}

	@Override
	public void initDefaultValue() {
		logger.info("[初始化黑名单选项][start]");
		SelectValue sv0 = new SelectValue();
		sv0.setId("0");
		sv0.setName("否");
		SelectValue sv1 = new SelectValue();
		sv1.setId("1");
		sv1.setName("是");
		ruleValues.add(sv0);
		ruleValues.add(sv1);
		logger.info("[初始化黑名单选项][end][" + (JSON.toJSONString(ruleValues)) + "]");
	}

	@Override
	public String toHtml() {
		StringBuffer html = new StringBuffer();
		html.append("<tr>");
		html.append("<td>").append(getName()).append("</td>");
		html.append(
				"<td><select id='docblack' name='docblack' class='easyui-combobox' data-options=\"width:80,required:'required'\">");
		for (int i = 0; i < ruleValues.size(); i++) {
			html.append("<option value='").append(ruleValues.get(i).getId()).append("'>")
					.append(ruleValues.get(i).getName()).append("</option>");
		}
		html.append("</select></td>");
		html.append("</tr>");
		return html.toString();
	}

}
